package com.zhoukx.observer.improve;

/**
 * @ClassName BaiduSite
 * @Description:
 * @Author zhoukx
 * @Date 2020/8/17
 **/
public class BaiduSite implements  ObServer {
    // 温度  气压  湿度
    private float temperature;
    private float pressure;
    private float humidity;

    // 更新的  天气情况 使用weathData 来调用，我使用推送模式
    @Override
    public void update(float temperature, float pressure, float humidity) {
        this.temperature = temperature;
        this.pressure = pressure;
        this.humidity = humidity;
        display();
    }

    // 显示的
    public void display() {
        System.out.println("***Baidu网站: " + temperature + "***");
        System.out.println("***Baidu网站: " + pressure + "***");
        System.out.println("***Baidu网站: " + humidity + "***");
    }
}
